<!-- doUserReg.php 用于将用户输入的注册信息添加到数据库。 -->
<?php
   require_once('inc_admin.php'); 
  //连接数据库		
  connect();

  if(!empty($_FILES["zqy_pic"]["name"])){
  	$zqy_pic = uploadfile('zqy_pic','./upload/',array('jpg','gif','png'));
  }
  else{
  	$zqy_pic='';
  }

  $data = array(
		'zqy_title' => trim($_POST['zqy_title']),  
		'zqy_place' => $_POST['zqy_place'],
		'zqy_intro' => $_POST['zqy_intro'],
		'zqy_adddate' => $_POST['zqy_adddate'],
		'zqy_hint' => $_POST['zqy_hint'],
		'zqy_pic'=>$zqy_pic
  	);

  //执行SQL语句
	$result = add('flower',$data);

  if(!$result){
  	echo "注册失败！<br/>";
  	echo "<a href='flowerreg.html'>返回</a>";	  
  }else{	  
 	echo "添加成功！";
	echo "或返回<a href='flowerlist.php'>鲜花列表</a>页面！";	  
  }    
  
?>